<template>
  <div>
    <CategorySelector :isForbiddenForm="scene===1" style="margin-bottom:10px"></CategorySelector>
    <SpuList v-if="scene===1" @changeScene="saveScene" @toSpuFormGetData="saveSpuInfo"></SpuList>
    <SpuForm v-if="scene===2" @changeScene="saveScene" :currentSpuInfo="currentSpuInfo"></SpuForm>
    <SkuForm v-if="scene===3" @changeScene="saveScene" :currentSpuInfo="currentSpuInfo"></SkuForm>
  </div>
</template>

<script lang="ts">
import CategorySelector from "@/components/CategorySelector/index.vue";
import SkuForm from './components/SkuForm.vue'
import SpuForm from './components/SpuForm.vue'
import SpuList from './components/SpuList.vue'
export default {
  name: "Spu",
  components: {
    CategorySelector,
    SpuList,
    SpuForm,
    SkuForm
  },
};
</script>
<script lang="ts" setup>
import {ref} from 'vue'
const currentSpuInfo = ref([])
const scene = ref(1)
const saveScene = (val:number) => {
  scene.value = val
}

const saveSpuInfo = (spuInfo:any) => {
  currentSpuInfo.value = {
    ...spuInfo,
    spuImageList:[],
    spuSaleAttrList:[]
  }
   
 
}
</script>

<style>
</style>